package org.example.clienet.controller;

import org.apache.tomcat.jni.User;
import org.example.clienet.entity.Users;
import org.example.clienet.service.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {
    @Autowired
    FeignService feignService;

    @GetMapping(value = "/hifeign")
    public String hello(){
        return feignService.getPort();
    }
    //feign的参数绑定
    @GetMapping(value = "/helloUser")
    public String helloUser(){
        StringBuilder info=new StringBuilder();
        String r1 = feignService.hello("刁心婷");

        String r2 = feignService.hello(String.valueOf(new Users("229981204")));
        info.append(r1).append("<BR/>").append(r2).append("<BR/>");
        return info.toString();
    }

}
